﻿<ribbon:RibbonWindow x:Class="OODCRM.MainWindow"        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
        xmlns:vm="clr-namespace:OODCRM.ViewModel"
                     xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    
        Title="MainWindow" Height="768" Width="1024">
    <Grid>
        <Grid.Resources>

            <!--
            Styles for ribbon
            implicit styles to make bindings for ribbon
            >>> Author: viettp
            -->
            <!-- RibbonControl -->
            <Style x:Key="RibbonControlStyle">
                <Setter Property="ribbon:RibbonControlService.Label" Value="{Binding Label}" />
                <Setter Property="ribbon:RibbonControlService.LargeImageSource" Value="{Binding LargeImage}" />
                <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterTitle" Value="{Binding ToolTipFooterTitle}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterDescription" Value="{Binding ToolTipFooterDescription}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{Binding ToolTipFooterImage}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding LargeImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.LargeImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ToolTipImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ToolTipFooterImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <Trigger Property="ribbon:RibbonControlService.IsInQuickAccessToolBar" Value="False">
                        <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
                    </Trigger>
                </Style.Triggers>
            </Style>

            <!-- RibbonGroup -->
            <Style TargetType="{x:Type ribbon:RibbonGroup}"  BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="QuickAccessToolBarId" Value="{Binding Label}" />
                <Setter Property="Header" Value="{Binding Label}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonButton -->
            <Style TargetType="{x:Type ribbon:RibbonButton}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonToggleButton -->
            <Style TargetType="{x:Type ribbon:RibbonToggleButton}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonRadioButton -->
            <Style TargetType="{x:Type ribbon:RibbonRadioButton}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonCheckBox -->
            <Style TargetType="{x:Type ribbon:RibbonCheckBox}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonTextBox -->
            <Style TargetType="{x:Type ribbon:RibbonTextBox}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="Text" Value="{Binding Text}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonMenuButton -->
            <Style TargetType="{x:Type ribbon:RibbonMenuButton}" BasedOn="{StaticResource RibbonControlStyle}">
                <Setter Property="QuickAccessToolBarId" Value="{Binding Command}" />
                <Setter Property="CanUserResizeVertically" Value="{Binding IsVerticallyResizable}" />
                <Setter Property="CanUserResizeHorizontally" Value="{Binding IsHorizontallyResizable}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonSplitButton -->
            <Style TargetType="{x:Type ribbon:RibbonSplitButton}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
                <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
                <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Label}" />
                <Setter Property="DropDownToolTipTitle" Value="{Binding DropDownButtonData.ToolTipTitle}" />
                <Setter Property="DropDownToolTipDescription" Value="{Binding DropDownButtonData.ToolTipDescription}" />
                <Setter Property="DropDownToolTipImageSource" Value="{Binding DropDownButtonData.ToolTipImage}" />
                <Setter Property="DropDownToolTipFooterTitle" Value="{Binding DropDownButtonData.ToolTipFooterTitle}" />
                <Setter Property="DropDownToolTipFooterDescription" Value="{Binding DropDownButtonData.ToolTipFooterDescription}" />
                <Setter Property="DropDownToolTipFooterImageSource" Value="{Binding DropDownButtonData.ToolTipFooterImage}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonComboBox -->
            <Style TargetType="{x:Type ribbon:RibbonComboBox}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
                <Setter Property="IsEditable" Value="True" />
                <Setter Property="CanUserResizeVertically" Value="True" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonGallery FilterItemContainerStyle -->
            <Style TargetType="{x:Type ribbon:RibbonMenuItem}" x:Key="FilterMenuItemStyle">
                <Setter Property="Header" Value="{Binding Label}"/>
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonGallery -->
            <Style TargetType="{x:Type ribbon:RibbonGallery}">
                <Style.Resources>
                    <!-- Note that this Style has been specified only to trump the 
                         implicit style for RibbonMenuItem from being picked by the 
                         items within the FilterMenuButton -->
                    <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
                </Style.Resources>
                <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
                <Setter Property="ItemsSource" Value="{Binding CategoryDataCollection}" />
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="SelectedItem" Value="{Binding SelectedItem}" />
                <Setter Property="CanUserFilter" Value="{Binding CanUserFilter}" />
                <Setter Property="FilterItemContainerStyle" Value="{StaticResource FilterMenuItemStyle}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{x:Null}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <!-- RibbonGalleryCategory -->
            <Style TargetType="{x:Type ribbon:RibbonGalleryCategory}">
                <Setter Property="Header" Value="{Binding Label}" />
                <Setter Property="ItemsSource" Value="{Binding GalleryItemDataCollection}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <!-- RibbonMenuItem -->
            <Style TargetType="{x:Type ribbon:RibbonMenuItem}">
                <Setter Property="Header" Value="{Binding Label}" />
                <Setter Property="ImageSource" Value="{Binding SmallImage}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterTitle" Value="{Binding ToolTipFooterTitle}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterDescription" Value="{Binding ToolTipFooterDescription}" />
                <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{Binding ToolTipFooterImage}" />
                <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
                <Setter Property="Command" Value="{Binding Command}" />
                <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
                <Setter Property="IsChecked" Value="{Binding IsChecked}" />
                <Setter Property="CanUserResizeVertically" Value="{Binding IsVerticallyResizable}" />
                <Setter Property="CanUserResizeHorizontally" Value="{Binding IsHorizontallyResizable}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
                        <Setter Property="ImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ToolTipImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ToolTipFooterImage}" Value="{x:Null}">
                        <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{x:Null}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <!-- RibbonSplitMenuItem -->
            <Style TargetType="{x:Type ribbon:RibbonSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}">
                <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Command}" />
                <Setter Property="QuickAccessToolBarId" Value="{Binding DropDownButtonData.Command}" />
                <Setter Property="HeaderKeyTip" Value="{Binding KeyTip}" />
                <Setter Property="KeyTip" Value="{Binding DropDownButtonData.KeyTip}" />
                <Setter Property="DropDownToolTipTitle" Value="{Binding DropDownButtonData.ToolTipTitle}" />
                <Setter Property="DropDownToolTipDescription" Value="{Binding DropDownButtonData.ToolTipDescription}" />
                <Setter Property="DropDownToolTipImageSource" Value="{Binding DropDownButtonData.ToolTipImage}" />
                <Setter Property="DropDownToolTipFooterTitle" Value="{Binding DropDownButtonData.ToolTipFooterTitle}" />
                <Setter Property="DropDownToolTipFooterDescription" Value="{Binding DropDownButtonData.ToolTipFooterDescription}" />
                <Setter Property="DropDownToolTipFooterImageSource" Value="{Binding DropDownButtonData.ToolTipFooterImage}" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding DropDownButtonData.ToolTipImage}" Value="{x:Null}">
                        <Setter Property="DropDownToolTipImageSource" Value="{x:Null}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding DropDownButtonData.ToolTipFooterImage}" Value="{x:Null}">
                        <Setter Property="DropDownToolTipFooterImageSource" Value="{x:Null}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <!-- RibbonApplicationMenuItem -->
            <Style TargetType="{x:Type ribbon:RibbonApplicationMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}">
                <Style.Triggers>
                    <Trigger Property="Level" Value="Middle">
                        <Setter Property="ImageSource" Value="{Binding SmallImage}" />
                        <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
                        <Setter Property="Command" Value="{Binding Command}" />
                        <Setter Property="Header" Value="{Binding}" />
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <AccessText Grid.Row="0" FontWeight="Bold" Text="{Binding Label}" />
                                        <TextBlock Grid.Row="1" Text="{Binding ToolTipTitle}" TextWrapping="Wrap" />
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>

            <!-- RibbonApplicationSplitMenuItem -->
            <Style TargetType="{x:Type ribbon:RibbonApplicationSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonSplitMenuItem}}" />

            <!-- RibbonContextMenu -->
            <Style TargetType="{x:Type ribbon:RibbonContextMenu}">
                <Style.Resources>
                    <!-- Note that this Style has been specified only to trump the 
                         implicit style for RibbonMenuItem from being picked by the 
                         items within the ContextMenu -->
                    <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
                </Style.Resources>
            </Style>

            <!-- RibbonControlGroup -->
            <Style TargetType="{x:Type ribbon:RibbonControlGroup}">
                <Setter Property="Margin" Value="2,0,2,0" />
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>

            <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
            <!-- RibbonContextualTabGroup -->
            <Style TargetType="{x:Type ribbon:RibbonContextualTabGroup}">
                <Setter Property="Header" Value="{Binding Header}" />
                <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
            </Style>

            <!-- RibbonTab -->
            <Style TargetType="{x:Type ribbon:RibbonTab}">
                <Setter Property="ContextualTabGroupHeader" Value="{Binding ContextualTabGroupHeader}" />
                <Setter Property="Header" Value="{Binding Header}" />
                <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                <Setter Property="KeyTip" Value="{Binding KeyTip}"/>
                <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
            </Style>
            <!--End - Styles for ribbon-->

        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--
        Menu ribbon for application
        -->
        <ribbon:Ribbon x:Name="ribbon" HelpPaneContent="{x:Static vm:RibbonModel.Help}"
                       >
            <ribbon:Ribbon.HelpPaneContentTemplate>
                <DataTemplate>
                    <ribbon:RibbonButton DataContext="{Binding}" />
                </DataTemplate>
            </ribbon:Ribbon.HelpPaneContentTemplate>

            <!--
            Tab Home
            >>> Author: viettp
            -->
            <ribbon:RibbonTab DataContext="{x:Static vm:RibbonModel.TabHome}">

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.DuLieu_Group}">
                    <ribbon:RibbonControlGroup>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.DuLieu_Nap}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.DuLieu_In}"/>
                    </ribbon:RibbonControlGroup>
                    <ribbon:RibbonControlGroup>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.DuLieu_Import}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.DuLieu_Export}"/>
                    </ribbon:RibbonControlGroup>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.VCL_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VCL_Add}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VCL_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VCL_Remove}"/>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.VDL_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VDL_Add}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VDL_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.VDL_Remove}"/>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.GhiChu_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.GhiChu_Add}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.GhiChu_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.GhiChu_Remove}"/>
                </ribbon:RibbonGroup>

            </ribbon:RibbonTab>

            <!--
            Tab Doi Tuong
            >>> Author: viettp
            -->
            <ribbon:RibbonTab DataContext="{x:Static vm:RibbonModel.TabDoiTuong}">

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.TiemNang_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TiemNang_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TiemNang_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TiemNang_Delete}"/>
                    <ribbon:RibbonControlGroup>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TiemNang_ChuyenDoi}"/>
                    </ribbon:RibbonControlGroup>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.CoHoi_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_Delete}"/>
                    <ribbon:RibbonMenuButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiTac}">
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiTac_Add}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiTac_Edit}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiTac_Remove}"/>
                    </ribbon:RibbonMenuButton>
                    <ribbon:RibbonMenuButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiThu}">
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiThu_Add}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiThu_Edit}"/>
                        <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.CoHoi_DoiThu_Remove}"/>
                    </ribbon:RibbonMenuButton>
                </ribbon:RibbonGroup>

                <!--
                Tab To Chuc
                >>> Author: cyworld8x
                -->
                <ribbon:RibbonGroup Header="Tổ chức" DataContext="{x:Static vm:RibbonModel.ToChuc_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ToChuc_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ToChuc_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ToChuc_Delete}"/>
                </ribbon:RibbonGroup>

                <!--
                Tab Lien He
                >>> Author: cyworld8x
                -->
                <ribbon:RibbonGroup Header="Liên hệ" DataContext="{x:Static vm:RibbonModel.LienHe_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.LienHe_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.LienHe_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.LienHe_Delete}"/>
                </ribbon:RibbonGroup>

                <!--
                Tab Chien dich
                >>> Author: viettp
                -->
                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.ChienDich_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ChienDich_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ChienDich_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.ChienDich_Delete}"/>
                </ribbon:RibbonGroup>

            </ribbon:RibbonTab>


            <ribbon:RibbonTab DataContext="{x:Static vm:RibbonModel.TabDanhMuc}">

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.TinhHuong_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TinhHuong_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TinhHuong_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.TinhHuong_Delete}"/>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup DataContext="{x:Static vm:RibbonModel.SanPham_Group}">
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.SanPham_New}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.SanPham_Edit}"/>
                    <ribbon:RibbonButton DataContext="{x:Static vm:RibbonModel.SanPham_Delete}"/>
                </ribbon:RibbonGroup>

            </ribbon:RibbonTab>

        </ribbon:Ribbon>

        <!--
        Grid for all the display
        -->
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <!--
            Left side bar of application
            >>> Author: viettp
            -->
            <Grid x:Name="LeftSide">
                <Rectangle Fill="Green" MinWidth="100"/>
                <ScrollViewer CanContentScroll="False">
                    <StackPanel x:Name="stackLeftSide">
                        <StackPanel.Resources>

                            <!--Style of navigation buttons, make them checked and unchecked
                            and only onebutton is checked at a time-->
                            <Style TargetType="RadioButton">
                                <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"/>
                                <Setter Property="IsChecked" Value="{Binding IsChecked}"/>
                                <Setter Property="Command" Value="{Binding Command}"/>
                                <Setter Property="Content" Value="{Binding}"/>
                                <Setter Property="Margin" Value="3,1"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="RadioButton">
                                            <ToggleButton IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsEnabled}"
                                                      IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsChecked}"
                                                      CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
                                                      Command="{Binding RelativeSource={RelativeSource TemplatedParent},  Path=Command}"
                                                      Content="{Binding}" HorizontalContentAlignment="Left"
                                                      >

                                                <ToggleButton.ContentTemplate>
                                                    <DataTemplate DataType="vm:NavigationItemData">
                                                        <StackPanel Orientation="Horizontal">
                                                            <Image Source="{Binding Image}" MaxWidth="30" Margin="3"/>
                                                            <TextBlock Text="{Binding Label}" VerticalAlignment="Center" Margin="3"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ToggleButton.ContentTemplate>

                                            </ToggleButton>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </StackPanel.Resources>

                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.SanPham}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.ToChuc}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.ChienDich}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.LienHe}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.CoHoi}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.TinhHuong}"/>
                        <RadioButton GroupName="LeftSideBar" DataContext="{x:Static vm:NavigationModel.TiemNang}"/>
                        <RadioButton GroupName="LeftSideBar"/>
                    </StackPanel>
                </ScrollViewer>
            </Grid>

            <!--Splitter for dynamic layout-->
            <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Left" Background="Gray"/>

            <!--
            The main content for all features
            Organized as a TabControl with each TabItem used for a corresponding feature of application.
            The chosen feature is select in the left side or in the ribbon menu.
            >>> Author: viettp
            -->
            <TabControl Grid.Column="1" Margin="5,0,0,0" x:Name="tabControl">

                <!--Hide the header of tab items-->
                <TabControl.ItemContainerStyle>
                    <Style TargetType="TabItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="TabItem"/>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TabControl.ItemContainerStyle>

                <!--
                add dialogs
                >>> Author: Cyworld8x
                -->
                <!--add dialog Them To Chuc-->
                <TabItem Header="Tổ chức" x:Name="tabThemToChucDialog">
                    <Grid Height="Auto" Width="Auto">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="120"/>

                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>

                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemToChucDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin tổ chức" Name="tabItemThongTinChung_tabThemToChucDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>


                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)" Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemToChucDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinWidth="150" Text="{Binding MaHieu, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tên tổ chức (*)" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="tbxTenToChuc_tabThemToChucDialog" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding TenToChuc, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            <TextBlock Text="Chủ quản " Margin="5" Grid.Row="2"/>
                                            <ComboBox x:Name="cbxChuQuan_tabThemToChucDialog" Grid.Row="2" 
                         Grid.Column="1"  Margin="5">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding MaHieu}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5" Grid.Row="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Loại " Margin="5"/>
                                            <ComboBox x:Name="cbxLoaiToChuc_tabThemToChucDialog" Grid.Row="0" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding LOAITOCHUC}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenLoaiToChuc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Lĩnh vực" Margin="5" Grid.Row="1" />
                                            <ComboBox x:Name="cbxLinhVuc_tabThemToChucDialog" Grid.Row="1" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding LINHVUC1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenLinhVuc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Số lượng nhân viên" Margin="5" Grid.Row="2" />
                                            <ComboBox x:Name="cbxSLNhanVien_tabThemToChucDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding SLNHANVIEN1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding SLNVTu}"/>
                                                            <TextBlock Text=" - "/>
                                                            <TextBlock Text="{Binding SLNVDen}"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Doanh thu năm" Margin="5" Grid.Row="3" />
                                            <ComboBox x:Name="cbxDoanhThuNam_tabThemToChucDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding DOANHTHUNAM1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding DoanhThuTu}"/>
                                                            <TextBlock Text=" - "/>
                                                            <TextBlock Text="{Binding DoanhThuDen}"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã số thuế" Margin="5" Grid.Row="4" />
                                            <TextBox x:Name="tbxMaSoThue_tabThemToChucDialog" Grid.Row="4" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding MaSoThue}" />
                                            <TextBlock Text="Ngân hàng" Margin="5" Grid.Row="5" Grid.RowSpan="2"/>
                                            <TextBox x:Name="tbxNganHang_tabThemToChucDialog" Grid.Row="5" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"  MinHeight="60"
                         Text="{Binding NganHang}" />
                                            <TextBlock Text="Diễn giải" Margin="5" Grid.Row="6" Grid.RowSpan="2"/>
                                            <TextBox x:Name="tbxDienGiai_tabThemToChucDialog" Grid.Row="6" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"  MinHeight="80"
                         Text="{Binding DienGiai}" />


                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5"  Grid.Row="1" Grid.Column="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>


                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Tel" Margin="5"/>
                                            <TextBox x:Name="tbxTel_tabThemToChucDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         MinWidth="150" Text="{Binding Tel}"/>
                                            <TextBlock Text="Fax" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="tbxFax_tabThemToChucDialog" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding Fax}" />
                                            <TextBlock Text="Email " Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxEMail_tabThemToChucDialog" Grid.Row="2" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding Email}"/>
                                            <TextBlock Text="Website " Margin="5" Grid.Row="3"/>
                                            <TextBox x:Name="tbxWebSite_tabThemToChucDialog" Grid.Row="3" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding Website}"  />
                                            <TextBlock Text="Đánh giá " Margin="5" Grid.Row="4"/>
                                            <TextBox x:Name="tbxDanhGia_tabThemToChucDialog" Grid.Row="4" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding DanhGia}"  />
                                            
                                            <!--<TextBlock Text="Phân loại" Margin="5" Grid.Row="6" />
                                            <ComboBox x:Name="cbxPhanLoai_tabThemToChucDialog" Grid.Row="6" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding CHITIETPHANLOAITOCHUCs.FirstOrDefault(), Path=PHANLOAITOCHUC}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenPhanLoai}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>-->
                                            
                                            <TextBlock Text="Loại sở hữu" Margin="5" Grid.Row="7" />
                                            <ComboBox x:Name="cbxLoaiSoHuu_tabThemToChucDialog" Grid.Row="7" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding LOAISOHUU1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenLoaiSoHuu}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã chứng khoán " Margin="5" Grid.Row="8"/>
                                            <TextBox x:Name="tbxMaChungKhoan_tabThemToChucDialog" Grid.Row="8" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding MaChungKhoan}"  />
                                            <TextBlock Text="Chủ sở hữu " Margin="5" Grid.Row="9"/>
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemToChucDialog" Grid.Row="9" 
                         Grid.Column="1"  Margin="5"
                         SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <CheckBox x:Name="chkDungChung_tabThemToChucDialog" Content="Dùng chung"  Grid.Column="1"  Grid.Row="10"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.DungChung}"/>


                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="110"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkNgungTheoDoi_tabThemToChucDialog" Content="Ngừng theo dõi" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.NgungTheoDoi}"/>
                                            <TextBlock Text="Là tổ chức từ " Margin="5" Grid.Row="0" Grid.Column="1"
                           HorizontalAlignment="Right" VerticalAlignment="Top"/>
                                            <toolkit:DatePicker x:Name="dpNgaySoHuu__tabThemToChucDialog" Grid.Row="0" Grid.Column="2" Text="{Binding NgayLapToChuc}" SelectedDateFormat="Short" 
                                                                SelectedDate="{Binding NgayLapToChuc}"/>


                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                            <TabItem Header="Địa chỉ" Name="tabItemDiaChi_tabThemToChucDialog">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>


                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="0" BorderBrush="#FF149A08" BorderThickness="1"
                                            DataContext="{Binding DIACHI1}">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ thanh toán:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiTT_tabThemToChucDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChi1}"/>

                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaTT_tabThemToChucDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaTT_tabThemToChucDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhTT_tabThemToChucDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY1}" SelectionChanged="cbxTinhThanhTT_tabThemToChucDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            
                                            <TextBlock Text="Quận/Huyện" Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenTT_tabThemToChucDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY2}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungTT_tabThemToChucDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding MaVung, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            

                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="1" BorderBrush="#FF149A08" BorderThickness="1"
                                            DataContext="{Binding DIACHI}">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ chuyển hàng:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiCH_tabThemToChucDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChi1}"/>
                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhCH_tabThemToChucDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY1}" SelectionChanged="cbxTinhThanhCH_tabThemToChucDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Quận/Huyện " Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenCH_tabThemToChucDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY2}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungCH_tabThemToChucDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding MaVung, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaCH_tabThemToChucDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaCH_tabThemToChucDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                        <Button x:Name="btnCat_tabThemToChucDialog" Content="Cất" Grid.Row="1" Grid.Column="0" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True" Click="btnCat_tabThemToChucDialog_Click"/>
                        <Button x:Name="btnHuyBo_tabThemToChucDialog" Content="Huỷ bỏ" Grid.Row="1" Grid.Column="1" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" Click="btnHuyBo_tabThemToChucDialog_Click"/>
                    </Grid>
                </TabItem>
                <!--end add dialog Them to chuc-->
                <!--add dialog Them San Pham-->
                <TabItem Header="Sản phẩm" x:Name="tabThemSanPhamDialog" >
                    <Grid>
                        <Border Margin="5,5,5,50" CornerRadius="5">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>

                                <TextBlock Text="Mã sản phẩm (*)" Margin="5"/>
                                <TextBox x:Name="tbxMaSanPham" Grid.Column="1" Margin="5"
                         MinWidth="150" Text="{Binding MaSanPham}"/>

                                <TextBlock Text="Tên sản phẩm (*)" Margin="5" Grid.Row="1"/>
                                <TextBox x:Name="tbxTenSanPham" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding TenSanPham}"/>

                                <TextBlock Text="Phân loại" Margin="5" Grid.Row="2"/>
                                <ComboBox x:Name="cbxPhanLoai" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding PHANLOAISANPHAM}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding TenPhanLoai}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>

                                <TextBlock Text="Đơn vị" Margin="5" Grid.Row="3"/>
                                <TextBox x:Name="tbxDonVi" Grid.Row="3" Grid.Column="1" Margin="5"
                         Text="{Binding DonVi,ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

                                <TextBlock Text="Đơn giá" Grid.Row="3" Grid.Column="2" Margin="5"/>
                                <TextBox x:Name="tbxDonGia" Grid.Row="3" Grid.Column="3" Margin="5"
                         MinWidth="150" Text="{Binding DonGia, ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

                                <TextBlock Text="Diễn giải" Grid.Row="4" Margin="5"/>
                                <TextBox x:Name="tbxDienGiai" Grid.Row="4" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5" MinHeight="100"
                         Text="{Binding DienGiai}"/>

                            </Grid>
                        </Border>

                        <CheckBox x:Name="chkNgungTheoDoi" Content="Ngừng theo dõi" Margin="5,5,5,30" 
                  VerticalAlignment="Bottom" HorizontalAlignment="Left"
                  IsChecked="{Binding NgungTheoDoi}"/>
                        <Button x:Name="btnCat" Content="Cất" Margin="5,5,70,5" 
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Width="60" IsDefault="True" Click="btnCat_tabThemSanPhamDialog_Click"/>
                        <Button x:Name="btnHuyBo" Content="Huỷ bỏ" Margin="5,5,5,5" 
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Width="60" IsCancel="True" Click="btnHuyBo_tabThemSanPhamDialog_Click"/>

                    </Grid>
                </TabItem>
                <!--end add dialog Them San Pham-->
                <!--add dialog Them Chien Dich-->
                <TabItem Header="Chiến dịch" x:Name="tabThemChienDichDialog" >
                    <Grid Height="Auto" Width="Auto">
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemChienDichDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin chiến dịch" Name="tabItemThongTinChung_tabThemChienDichDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>

                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)" Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemChienDichDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="5"
                         MinWidth="150" Text="{Binding MaHieu}"/>
                                            <TextBlock Text="Tên chiến dịch (*)" Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxTenChienDich_tabThemChienDichDialog" Grid.Row="2" Grid.ColumnSpan="5" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding TenChienDich}"  />
                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" Grid.Row="1" BorderBrush="#FF149A08" BorderThickness="1" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="240"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Loại" Margin="5"/>
                                            <ComboBox x:Name="cbxLoai_tabThemChienDichDialog" Grid.Row="0" 
                          Grid.Column="1"  Margin="5"
                          SelectedItem="{Binding LOAICHIENDICH1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenLoaiChienDich}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Ngày bắt đầu: " Margin="5" Grid.Row="0" Grid.Column="2"/>
                                            <toolkit:DatePicker x:Name="dpNgayBatDau_tabThemChienDichDialog" Grid.Row="0" Grid.Column="3"  
                          Margin="5" SelectedDate="{Binding NgayBatDau,StringFormat=dd/MM/yyyy}"  />
                                            <TextBlock Text="Tình trạng" Margin="5" Grid.Row="1"/>
                                            <ComboBox x:Name="cbxTinhTrang_tabThemChienDichDialog" Grid.Row="1" 
                          Grid.Column="1" Margin="5"
                          SelectedItem="{Binding TINHTRANGCHIENDICH}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding NdTinhTrang}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Ngày kết thúc: " Margin="5" Grid.Row="1" Grid.Column="2"/>
                                            <toolkit:DatePicker x:Name="dpNgayKetThuc_tabThemChienDichDialog" Grid.Row="1" Grid.Column="3" 
                          Margin="5" SelectedDate="{Binding NgayKetThuc,StringFormat=dd/MM/yyyy}"  />
                                            <TextBlock Text="Diễn giải: " Margin="5" Grid.Row="2" Grid.Column="0"/>
                                            <TextBox x:Name="tbxDienGiai_tabThemChienDichDialog" Grid.Row="2" Grid.ColumnSpan="5" 
                         Grid.Column="1"  Margin="5" MinHeight="60"
                         Text="{Binding DienGiai}"  />



                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5" Grid.Row="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>


                                            </Grid.RowDefinitions>

                                            <TextBlock Text="SL đã gửi" Margin="5"/>
                                            <TextBox x:Name="tbxSoLuongDG_tabThemChienDichDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding SLDaGui,ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="SL hồi âm kỳ vọng" Margin="5" Grid.Row="1" />
                                            <TextBox x:Name="tbxTelCQ_tabThemChienDichDialog" Grid.Row="1"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding SLHoiAmKyVong,ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tổng số hồi âm" Margin="5" Grid.Row="2" />
                                            <TextBox x:Name="tbxTongSoHoiAm_tabThemChienDichDialog" Grid.Row="2"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TongSoHoiAm, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tổng số tiềm năng" Margin="5" Grid.Row="3" />
                                            <TextBox x:Name="tbxTongSoTiemNang_tabThemChienDichDialog" Grid.Row="3"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TongSoTiemNang, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tổng số liên hệ" Margin="5" Grid.Row="4" />
                                            <TextBox x:Name="tbxTongSoLienHe_tabThemChienDichDialog" Grid.Row="4"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TongSoLienHe, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Doanh thu kỳ vọng" Margin="5" Grid.Row="5" />
                                            <TextBox x:Name="tbxDoanhThuKyVong_tabThemChienDichDialog" Grid.Row="5"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding DoanhThuKyVong, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Chi phí thực" Margin="5" Grid.Row="6" />
                                            <TextBox x:Name="tbxChiPhiThuc_tabThemChienDichDialog" Grid.Row="6"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding ChiPhiThuc,ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Chi phí dự trù" Margin="5" Grid.Row="7" />
                                            <TextBox x:Name="tbxChiPhiDuTru_tabThemChienDichDialog" Grid.Row="7"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding ChiPhiDuTru, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5"  Grid.Row="2" Grid.Column="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>



                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>


                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Tổng số cơ hội" Margin="5"/>
                                            <TextBox x:Name="tbxTongSoCoHoi_tabThemChienDichDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="3" 
                         Text="{Binding TongSoCoHoi, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tổng giá trị" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="TelTongGiaTri_tabThemChienDichDialog" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding TongGiaTri, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            <TextBlock Text="Số cơ hội thắng " Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxSoCoHoiThang_tabThemChienDichDialog" Grid.Row="2" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding SoCoHoiThang, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  />
                                            <TextBlock Text="Tổng giá trị thắng " Margin="5" Grid.Row="3"/>
                                            <TextBox x:Name="tbxTongGiaTriThang_tabThemChienDichDialog" Grid.Row="3" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding TongGiaTriThang, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  />

                                            <TextBlock Text="Chủ sở hữu" Margin="5" Grid.Row="4" />
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemChienDichDialog" Grid.Row="4" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                            <CheckBox x:Name="chkDungChung_tabThemChienDichDialog" Content="Dùng chung"  Grid.Column="1"  Grid.Row="5"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding NgungTheoDoi }"/>
                                            <Button x:Name="btnCapNhatTinhTrangChienDich_tabThemChienDichDialog" Content="Cập nhật tình trạng chiến dịch" Grid.Row="6" 
                         Grid.Column="1"  Margin="5"    Grid.ColumnSpan="1"                    
                HorizontalAlignment="Left" VerticalAlignment="Bottom"
                IsDefault="True"/>


                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="120"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkKetThuc_tabThemChienDichDialog" Content="kết thúc" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding NgungTheoDoi}"/>
                                            <Button x:Name="btnCat_tabThemChienDichDialog" Content="Cất" Grid.Row="0" Grid.Column="1" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True"  Click="btnCat_tabThemChienDichDialog_Click"/>
                                            <Button x:Name="btnHuyBo_tabThemChienDichDialog" Content="Huỷ bỏ" Grid.Row="0" Grid.Column="2" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" Click="btnHuyBo_tabThemChienDichDialog_Click"/>

                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                    </Grid>
                </TabItem>
                <!--end add dialog Them Chien Dich-->
                <!--add dialog  Them Lien he-->
                <TabItem Header="Liên hệ" x:Name="tabThemLienHeDialog" >
                    <Grid Height="Auto" Width="Auto">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="120"/>

                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemLienHeDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin liên hệ" Name="tabItemThongTinChung_tabThemLienHeDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)" Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemLienHeDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="6"
                         MinWidth="150" Text="{Binding MaHieu}"/>
                                            <TextBlock Text="Xưng hô" Margin="5" Grid.Row="1"/>
                                            <ComboBox x:Name="cbxXungHo_tabThemLienHeDialog" Grid.Row="1" 
                          Grid.Column="1"  Margin="5"
                          SelectedItem="{Binding XUNGHO1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding NdXungHo}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Họ và đệm" Margin="5" Grid.Column="2" Grid.Row="1" />
                                            <TextBox x:Name="tbxHoVaDem__tabThemLienHeDialog" Grid.Row="1" 
                         Grid.Column="3"  Margin="5"
                         Text="{Binding HoVaDem}" />
                                            <TextBlock Text="Tên" Margin="5" Grid.Column="4" Grid.Row="1"/>
                                            <TextBox x:Name="tbxTen__tabThemLienHeDialog" Grid.Row="1" 
                         Grid.Column="5"  Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Ten}" />
                                            <TextBlock Text="Họ và tên (*)" Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxHoVaTen_tabThemLienHeDialog" Grid.Row="2" Grid.ColumnSpan="6" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding HoVaTen}"  />


                                            <TextBlock Text="Tổ chức (*)" Margin="5" Grid.Row="3"/>
                                            <ComboBox x:Name="cbxToChuc_tabThemLienHeDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedValue="{Binding TOCHUC}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenToChuc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5" Grid.Row="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Chức danh" Margin="5"/>
                                            <TextBox x:Name="tbxChucDanh_tabThemLienHeDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding ChucDanh}"/>
                                            <TextBlock Text="Tel CQ" Margin="5" Grid.Row="1" />
                                            <TextBox x:Name="tbxTelCQ_tabThemLienHeDialog" Grid.Row="1"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelCQ, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Fax" Margin="5" Grid.Row="2" />
                                            <TextBox x:Name="tbxFax_tabThemLienHeDialog" Grid.Row="2"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Fax}"/>
                                            <TextBlock Text="Mobile" Margin="5" Grid.Row="3" />
                                            <TextBox x:Name="tbxMobile_tabThemLienHeDialog" Grid.Row="3"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Mobile, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Mobile khác" Margin="5" Grid.Row="4" />
                                            <TextBox x:Name="tbxMobileKhac_tabThemLienHeDialog" Grid.Row="4"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding MobileKhac,ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tel NR" Margin="5" Grid.Row="5" />
                                            <TextBox x:Name="tbxTelNR_tabThemLienHeDialog" Grid.Row="5"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelNR, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tel khác" Margin="5" Grid.Row="6" />
                                            <TextBox x:Name="tbxTelKhac_tabThemLienHeDialog" Grid.Row="6"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelKhac, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Email" Margin="5" Grid.Row="7" />
                                            <TextBox x:Name="tbxEmail_tabThemLienHeDialog" Grid.Row="7"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Email}"/>
                                            <TextBlock Text="Phòng ban" Margin="5" Grid.Row="8" />
                                            <TextBox x:Name="tbxPhongBan_tabThemLienHeDialog" Grid.Row="8"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding PhongBan}"/>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5"  Grid.Row="1" Grid.Column="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>


                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Trợ lý" Margin="5"/>
                                            <TextBox x:Name="tbxTroLy_tabThemLienHeDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="3" 
                         Text="{Binding TroLy}"/>
                                            <TextBlock Text="Tel trợ lý" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="TelTroLy_tabThemLienHeDialog" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                         Text="{Binding TelTroLy}" />
                                            <TextBlock Text="Phân loại" Margin="5" Grid.Row="3" />
                                            <ComboBox x:Name="cbxPhanLoai_tabThemLienHeDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding CHITIETPHANLOAILIENHE}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenPhanLoai}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Nguồn gốc" Margin="5" Grid.Row="4" />
                                            <ComboBox x:Name="cbxNguonGoc_tabThemLienHeDialog" Grid.Row="4" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding NGUONGOC1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenNguonGoc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Ngày sinh " Margin="5" Grid.Row="5"/>
                                            <toolkit:DatePicker x:Name="dpNgaySinh_tabThemLienHeDialog" Grid.Column="1" Grid.Row="5" 
                          Margin="5" SelectedDate="{Binding NgaySinh,StringFormat=dd/MM/yyyy}"  />
                                            <TextBlock Text="Diễn giải " Margin="5" Grid.Row="6"/>
                                            <TextBox x:Name="tbxDienGiaiLienHe_tabThemLienHeDialog" Grid.Row="6" 
                         Grid.Column="1"  Margin="5" Grid.ColumnSpan="3" MinHeight="60"
                         Text="{Binding DienGiai}"  />
                                            <TextBlock Text="Chủ sở hữu" Margin="5" Grid.Row="7"/>
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemLienHeDialog" Grid.Row="7" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                           
                                            <CheckBox x:Name="chkDungChung_tabThemLienHeDialog" Content="Dùng chung"  Grid.Column="0"  Grid.Row="8"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.DungChung}"/>
                                            <CheckBox x:Name="chkKhongEmail_tabThemLienHeDialog" Content="Không Email"  Grid.Column="1"  Grid.Row="8"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding KoEmail}"/>
                                            <CheckBox x:Name="chkKhongGoiDien_tabThemLienHeDialog" Content="Không gọi điện"  Grid.Column="2"  Grid.Row="8"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding KoGoiDien}"/>


                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="110"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkNgungTheoDoi_tabThemLienHeDialog" Content="Ngừng theo dõi" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.NgungTheoDoi}"/>
                                            <TextBlock Text="Là liên hệ từ ngày " Margin="5" Grid.Row="0" Grid.Column="1"
                           HorizontalAlignment="Right" VerticalAlignment="Top"/>
                                            <toolkit:DatePicker x:Name="dpNgayTaoLienHe_tabThemLienHeDialog" Grid.Row="0" Grid.Column="2" SelectedDate="{Binding NgayTao,StringFormat=dd/MM/yyyy}"  />


                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                            <TabItem Header="Địa chỉ" Name="tabItemDiaChi_tabThemLienHeDialog">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>


                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="0" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ cơ quan:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiCQ_tabThemLienHeDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhCQ_tabThemLienHeDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxTinhThanhCQ_tabThemLienHeDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Quận/Huyện " Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenCQ_tabThemLienHeDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" >
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungCQ_tabThemLienHeDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaCQ_tabThemLienHeDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaCQ_tabThemLienHeDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ nhà riêng:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiNR_tabThemLienHeDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhNR_tabThemLienHeDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxTinhThanhNR_tabThemLienHeDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Quận/Huyện " Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenNR_tabThemLienHeDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" >
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungNR_tabThemLienHeDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaNR_tabThemLienHeDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaNR_tabThemLienHeDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                        <Button x:Name="btnCat_tabThemLienHeDialog" Content="Cất" Grid.Row="1" Grid.Column="0" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True" Click="btnCat_tabThemLienHeDialog_Click"/>
                        <Button x:Name="btnHuyBo_tabThemLienHeDialog" Content="Huỷ bỏ" Grid.Row="1" Grid.Column="1" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" IsDefault="True" Click="btnHuyBo_tabThemLienHeDialog_Click"/>
                    </Grid>
                </TabItem>
                <!--end dialog Them Lien he-->
                <!--add dialog  Them tiem nang-->               
                
                <TabItem Header="Tiềm năng" x:Name="tabThemTiemNangDialog">
                    <Grid Height="Auto" Width="Auto">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="120"/>

                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemTiemNangDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin tiềm năng" Name="tabItemThongTinChung_tabThemTiemNangDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)" Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemTiemNangDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="6"
                         MinWidth="150" Text="{Binding MaHieu}"/>
                                            <TextBlock Text="Xưng hô" Margin="5" Grid.Row="1"/>
                                            <ComboBox x:Name="cbxXungHo_tabThemTiemNangDialog" Grid.Row="1" 
                          Grid.Column="1"  Margin="5"
                          SelectedItem="{Binding XUNGHO1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding NdXungHo}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Họ và đệm" Margin="5" Grid.Column="2" Grid.Row="1" />
                                            <TextBox x:Name="tbxHoVaDem__tabThemTiemNangDialog" Grid.Row="1" 
                         Grid.Column="3"  Margin="5"
                         Text="{Binding HoVaDem}" />
                                            <TextBlock Text="Tên" Margin="5" Grid.Column="4" Grid.Row="1"/>
                                            <TextBox x:Name="tbxTen_tabThemTiemNangDialog" Grid.Row="1" 
                         Grid.Column="5"  Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Ten}" />
                                            <TextBlock Text="Họ và tên (*)" Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxHoVaTen_tabThemTiemNangDialog" Grid.Row="2" Grid.ColumnSpan="6" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding HoVaTen}"  />


                                            <TextBlock Text="Tên công ty (*)" Margin="5" Grid.Row="3"/>
                                            <TextBox x:Name="tbxCongTy_tabThemTiemNangDialog" Grid.Row="3" Grid.ColumnSpan="6" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding CongTy}"  />
                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5" Grid.Row="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Chức danh" Margin="5"/>
                                            <TextBox x:Name="tbxChucDanh_tabThemTiemNangDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding ChucDanh}"/>
                                            <TextBlock Text="Tel CQ" Margin="5" Grid.Row="1" />
                                            <TextBox x:Name="tbxTelCQ_tabThemTiemNangDialog" Grid.Row="1"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelCQ, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Fax" Margin="5" Grid.Row="2" />
                                            <TextBox x:Name="tbxFax_tabThemTiemNangDialog" Grid.Row="2"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Fax, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Mobile" Margin="5" Grid.Row="3" />
                                            <TextBox x:Name="tbxMobile_tabThemTiemNangDialog" Grid.Row="3"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Mobile, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Mobile khác" Margin="5" Grid.Row="4" />
                                            <TextBox x:Name="tbxMobileKhac_tabThemTiemNangDialog" Grid.Row="4"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding MobileKhac, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tel NR" Margin="5" Grid.Row="5" />
                                            <TextBox x:Name="tbxTelNR_tabThemTiemNangDialog" Grid.Row="5"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelNR, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Tel khác" Margin="5" Grid.Row="6" />
                                            <TextBox x:Name="tbxTelKhac_tabThemTiemNangDialog" Grid.Row="6"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding TelKhac, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                                            <TextBlock Text="Email" Margin="5" Grid.Row="7" />
                                            <TextBox x:Name="tbxEmail_tabThemTiemNangDialog" Grid.Row="7"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding Email}"/>
                                            <TextBlock Text="Phòng ban" Margin="5" Grid.Row="8" />
                                            <TextBox x:Name="tbxPhongBan_tabThemTiemNangDialog" Grid.Row="8"  Grid.Column="1" Margin="5" Grid.ColumnSpan="2" 
                         Text="{Binding PhongBan}"/>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5"  Grid.Row="1" Grid.Column="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>


                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="SL nhân viên" Margin="5"/>
                                            <ComboBox x:Name="cbxSLNhanVien_tabThemTiemNangDialog" Grid.Row="0" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding SLNHANVIEN1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding SLNVTu}"/>
                                                            <TextBlock Text=" - "/>
                                                            <TextBlock Text="{Binding SLNVDen}"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Doanh thu" Margin="5" Grid.Row="1"/>
                                            <ComboBox x:Name="cbxDoanhThu_tabThemTiemNangDialog" Grid.Row="1" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding DOANHTHUNAM1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding DoanhThuTu}"/>
                                                            <TextBlock Text=" - "/>
                                                            <TextBlock Text="{Binding DoanhThuDen}"/>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            
                                            <TextBlock Text="Nguồn gốc" Margin="5" Grid.Row="3" />
                                            <ComboBox x:Name="cbxNguonGoc_tabThemTiemNangDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding NGUONGOC1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenNguonGoc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Tình trạng" Margin="5" Grid.Row="4" />
                                            <ComboBox x:Name="cbxTinhTrang_tabThemTiemNangDialog" Grid.Row="4" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding TinhTrang}">
                                                <sys:String>Đã liên hệ</sys:String>
                                                <sys:String>Phù hợp</sys:String>
                                                <sys:String>Không phù hợp</sys:String>
                                            </ComboBox>
                                            <TextBlock Text="Đánh giá" Margin="5" Grid.Row="5" />
                                            <ComboBox x:Name="cbxDanhGia_tabThemTiemNangDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding DanhGia}">
                                                <sys:String>Rất quan tâm</sys:String>
                                                <sys:String>Vừa phải</sys:String>
                                                <sys:String>Ít quan tâm</sys:String>
                                            </ComboBox>
                                            <TextBlock Text="Diễn giải " Margin="5" Grid.Row="6"/>
                                            <TextBox x:Name="tbxDienGiaiLienHe_tabThemTiemNangDialog" Grid.Row="6" 
                         Grid.Column="1"  Margin="5" Grid.ColumnSpan="3" MinHeight="60"
                         Text="{Binding DienGiai}"  />
                                            <TextBlock Text="Chủ sở hữu" Margin="5" Grid.Row="7"/>
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemTiemNangDialog" Grid.Row="7" 
                          Grid.Column="1" Grid.ColumnSpan="3" Margin="5"
                          SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                            <CheckBox x:Name="chkDungChung_tabThemTiemNangDialog" Content="Dùng chung"  Grid.Column="0"  Grid.Row="8"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.DungChung}"/>
                                            <CheckBox x:Name="chkKhongEmail_tabThemTiemNangDialog" Content="Không Email"  Grid.Column="1"  Grid.Row="8"  Margin="5,20,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding KoEmail}"/>
                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="110"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkNgungTheoDoi_tabThemTiemNangDialog" Content="Ngừng theo dõi" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.NgungTheoDoi}"/>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                            <TabItem Header="Địa chỉ" Name="tabItemDiaChi_tabThemTiemNangDialog">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>


                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="0" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ cơ quan:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiCQ_tabThemTiemNangDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhCQ_tabThemTiemNangDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxTinhThanhCQ_tabThemTiemNangDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Quận/Huyện " Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenCQ_tabThemTiemNangDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" >
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungCQ_tabThemTiemNangDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaCQ_tabThemTiemNangDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaCQ_tabThemTiemNangDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Column="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Địa chỉ nhà riêng:" Margin="5"/>
                                            <TextBox x:Name="tbxDiaChiNR_tabThemTiemNangDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         MinHeight="100" Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Tỉnh/Tp " Grid.Row="2" Margin="5"/>
                                            <ComboBox x:Name="cbxTinhThanhNR_tabThemTiemNangDialog" Grid.Row="2" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxTinhThanhNR_tabThemTiemNangDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Quận/Huyện " Grid.Row="3" Margin="5"/>
                                            <ComboBox x:Name="cbxQuanHuyenNR_tabThemTiemNangDialog" Grid.Row="3" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" >
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mã vùng:" Grid.Row="4" Margin="5"/>
                                            <TextBox x:Name="tbxMaVungNR_tabThemTiemNangDialog" Grid.Row="4" Grid.Column="1" Margin="5" Grid.ColumnSpan="2"
                         Text="{Binding DiaChiThanhToan}"/>
                                            <TextBlock Text="Quốc gia " Grid.Row="5" Margin="5"/>
                                            <ComboBox x:Name="cbxQuocGiaNR_tabThemTiemNangDialog" Grid.Row="5" 
                          Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                          SelectedItem="{Binding VITRIDIALY}" SelectionChanged="cbxQuocGiaNR_tabThemTiemNangDialog_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenVTDL}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                        <Button x:Name="btnCat_tabThemTiemNangDialog" Content="Cất" Grid.Row="1" Grid.Column="0" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True" Click="btnCat_tabThemTiemNangDialog_Click"/>
                        <Button x:Name="btnHuyBo_tabThemTiemNangDialog" Content="Huỷ bỏ" Grid.Row="1" Grid.Column="1" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" IsDefault="True" Click="btnHuyBo_tabThemTiemNangDialog_Click"/>
                    </Grid>
                </TabItem>
                <!--end tab dialog them tiem nang-->
                <!--add dialog Them Co Hoi-->
                <TabItem Header="Cơ hội" x:Name="tabThemCoHoiDialog" >
                    <Grid Height="Auto" Width="Auto">
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemCoHoiDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin cơ hội" Name="tabItemThongTinChung_tabThemCoHoiDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="0.5*"/>
                                                <ColumnDefinition Width="*"/>

                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)"  Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemCoHoiDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="1"
                         MinWidth="150" Text="{Binding MaHieu}"/>
                                            <TextBlock Text="Tên cơ hội (*)" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="tbxTenCoHoi_tabThemCoHoiDialog" Grid.Row="1" Grid.ColumnSpan="1" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding TenCoHoi}"  />
                                            <TextBlock Text="Tên tổ chức (*)" Margin="5" Grid.Row="2"/>
                                            <ComboBox x:Name="cbxToChuc_tabThemCoHoiDialog" Grid.Row="2" 
                          Grid.Column="1"  Margin="5" Grid.ColumnSpan="1" 
                          SelectedItem="{Binding TOCHUC}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenToChuc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Chiến dịch" Margin="5" Grid.Row="3"/>
                                            <ComboBox x:Name="cbxChienDich_tabThemCoHoiDialog" Grid.Row="3" 
                          Grid.Column="1"  Margin="5" Grid.ColumnSpan="1" 
                          SelectedItem="{Binding CHIENDICH}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenChienDich}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" Grid.Row="1" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="0.3*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="0.3*"/>

                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Loại" Margin="5"/>
                                            <ComboBox x:Name="cbxLoai_tabThemCoHoiDialog" Grid.Row="0" 
                          Grid.Column="1"  Margin="5"
                          SelectedItem="{Binding Loai}">
                                                            <!--<TextBlock Text="Khách hàng mới"/>
                                                            <TextBlock Text="Khách hàng cũ"/>-->
                                                <sys:String>Khách hàng cũ</sys:String>
                                                <sys:String>Khách hàng mới</sys:String>
                                            </ComboBox>
                                            <TextBlock Text="Doanh thu kỳ vọng " Margin="5" Grid.Row="0" Grid.Column="2"/>
                                            <TextBox x:Name="tbxDoanhThuKyVong_tabThemCoHoiDialog" Grid.Row="0" 
                         Grid.Column="3"  Margin="5" 
                         Text="{Binding Something}"  />
                                            <TextBlock Text="Nguồn gốc" Margin="5" Grid.Row="1"/>
                                            <ComboBox x:Name="cbxNguonGoc_tabThemCoHoiDialog" Grid.Row="1" 
                          Grid.Column="1" Margin="5"
                          SelectedValue="{Binding NGUONGOC1}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenNguonGoc}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Bước tiếp theo " Margin="5" Grid.Row="1" Grid.Column="2"/>
                                            <ComboBox x:Name="cbxBuocTiepTheo_tabThemCoHoiDialog" Grid.Row="1" 
                          Grid.Column="3" Margin="5"
                          SelectedItem="{Binding BUOCTIEPTHEOCOHOI}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding NoiDung}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Số tiền " Margin="5" Grid.Row="2" Grid.Column="0"/>
                                            <TextBox x:Name="tbxSoTien_tabThemCoHoiDialog" Grid.Row="2" 
                         Grid.Column="1"  Margin="5" 
                         Text="{Binding SoTien, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  />
                                            <TextBlock Text="Lý do thắng/thua " Margin="5" Grid.Row="2" Grid.Column="2"/>
                                            <ComboBox x:Name="cbxLyDoThangThua_tabThemCoHoiDialog" Grid.Row="2" 
                          Grid.Column="3" Margin="5"
                          SelectedItem="{Binding LYDOTHANGTHUACOHOI}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding NoiDung}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Giai đoạn (*)" Margin="5" Grid.Row="4"/>
                                            <ComboBox x:Name="cbxGiaiDoan_tabThemCoHoiDialog" Grid.Row="4" 
                          Grid.Column="1" Margin="5"
                          SelectedItem="{Binding GIAIDOANCOHOI}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenGiaiDoan}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Ngày kỳ vọng (*)" Margin="5" Grid.Row="4" Grid.Column="2"/>
                                            <toolkit:DatePicker x:Name="dpNgayKyVong_tabThemCoHoiDialog" Grid.Row="4" Grid.Column="3" 
                          Margin="5" SelectedDate="{Binding NgayKyVong, StringFormat=dd/MM/yyyy}"  />
                                            <TextBlock Text="Tỉ lệ thành công " Margin="5" Grid.Row="5" Grid.Column="0"/>
                                            <TextBox x:Name="tbxTiLeThanhCong_tabThemCoHoiDialog" Grid.Row="5" 
                         Grid.Column="1"  Margin="5" 
                         Text="{Binding TiLeThanhCong, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  />

                                            <TextBlock Text="Chủ sở hữu (*)" Margin="5" Grid.Column="2" Grid.Row="5"/>
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemCoHoiDialog" Grid.Row="5" 
                          Grid.Column="3" Margin="5"
                          SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Phân loại (*)" Margin="5" Grid.Row="6"/>
                                            <ComboBox x:Name="cbxPhanLoai_tabThemCoHoiDialog" Grid.Row="6" 
                          Grid.Column="1" Margin="5"
                          SelectedValue="{Binding CHITIETPHANLOAICOHOI}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenPhanLoai}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <CheckBox x:Name="chkDungChung_tabThemCoHoiDialog" Content="Dùng chung" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="4" Grid.Row="6"
                  IsChecked="{Binding DOITUONG.DungChung}"/>
                                            <TextBlock Text="Diễn giải " Margin="5" Grid.Row="7" Grid.Column="0"/>
                                            <TextBox x:Name="tbxDienGiai_tabThemCoHoiDialog" Grid.Row="7" 
                         Grid.Column="1"  Margin="5" Grid.ColumnSpan="3" MinHeight="80"
                         Text="{Binding DienGiai}"  />



                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="120"/>
                                                <ColumnDefinition Width="120"/>
                                                <ColumnDefinition Width="120"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkKetThuc_tabThemCoHoiDialog" Content="kết thúc" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding DOITUONG.NgungTheoDoi}"/>
                                            <TextBlock Text="Ngày kết thúc" Margin="5" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Right"/>
                                            <toolkit:DatePicker x:Name="dpNgayketThuc_tabThemCoHoiDialog" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left" 
                          Margin="5" SelectedDate="{Binding NgayKetThuc, StringFormat=dd/MM/yyyy}"  />
                                            <Button x:Name="btnCat_tabThemCoHoiDialog" Content="Cất" Grid.Row="1" Grid.Column="2" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True" Click="btnCat_tabThemCoHoiDialog_Click"/>
                                            <Button x:Name="btnHuyBo_tabThemCoHoiDialog" Content="Huỷ bỏ" Grid.Row="1" Grid.Column="3" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" Click="btnHuyBo_tabThemCoHoiDialog_Click"/>

                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                    </Grid>
                </TabItem>
                <!--end add dialog Them Co Hoi-->
                <!--add dialog Them Tinh Huong-->
                <TabItem Header="Tình huống" x:Name="tabThemTinhHuongDialog" >
                    <Grid Height="Auto" Width="Auto">
                        
                        <TabControl Grid.Column="0" Grid.ColumnSpan="2"  Name="tabControl_tabThemTinhHuongDialog" VerticalAlignment="Top" >
                            <TabItem Header="Thông tin tình huống" Name="tabItemThongTinChung_tabThemTinhHuongDialog">
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>


                                    <Border Margin="5" CornerRadius="5" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="100"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="70"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Mã hiệu (*)" Margin="5"/>
                                            <TextBox x:Name="tbxMaHieu_tabThemTinhHuongDialog" Grid.Column="1" Margin="5" Grid.ColumnSpan="1"
                         MinWidth="150" Text="{Binding MaHieu}"/>
                                            <TextBlock Text="Chủ đề (*)" Margin="5" Grid.Row="1"/>
                                            <TextBox x:Name="tbxChuDe_tabThemTinhHuongDialog" Grid.Row="1" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5"
                         Text="{Binding ChuDe}" />
                                            <TextBlock Text="Diễn giải " Margin="5" Grid.Row="2"/>
                                            <TextBox x:Name="tbxChuQuan_tabThemTinhHuongDialog" Grid.Row="2" 
                         Grid.Column="1" Grid.ColumnSpan="2" Margin="5" MinHeight="60"
                         Text="{Binding DienGiai}"  />


                                        </Grid>
                                    </Border>
                                    <Border Margin="5,5,5,5" CornerRadius="5" Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="#FF149A08" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="100"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>

                                            <TextBlock Text="Phân loại" Margin="5"/>
                                            <ComboBox x:Name="cbxPhanLoai_tabThemTinhHuongDialog" Grid.Row="0" 
                          Grid.Column="1" Margin="5"
                          SelectedItem="{Binding PHANLOAITINHHUONG}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenPhanLoai}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Tình trạng" Margin="5"  Grid.Column="2"/>
                                            <ComboBox x:Name="cbxTinhTrang_tabThemTinhHuongDialog" Grid.Row="0" 
                          Grid.Column="3" Grid.ColumnSpan="1" Margin="5"
                          SelectedItem="{Binding TINHTRANGTINHHUONG}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenTinhTrang}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Nguồn gốc" Margin="5" Grid.Row="1" />
                                            <ComboBox x:Name="cbxNguonGoc_tabThemTinhHuongDialog" Grid.Row="1" 
                          Grid.Column="1"  Margin="5"
                          SelectedItem="{Binding NGUONGOCTINHHUONG}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding GiaTri}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Loại" Margin="5" Grid.Column="2" Grid.Row="1" />
                                            <ComboBox x:Name="cbxLoai_tabThemTinhHuongDialog" Grid.Column="3" Grid.Row="1" 
                           Margin="5" SelectedItem="{Binding LOAITINHHUONG}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding TenLoaiTinhHuong}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Mức độ ưu tiên" Margin="5" Grid.Row="2" />
                                            <ComboBox x:Name="cbxMucDoYeuTien_tabThemTinhHuongDialog" Grid.Row="2" 
                          Grid.Column="1" Margin="5"
                          SelectedItem="{Binding MucDoUuTien}">
                                                <sys:String>Cao</sys:String>
                                                <sys:String>Trung bình</sys:String>
                                                <sys:String>Thấp</sys:String>
                                            </ComboBox>
                                            <TextBlock Text="Nguyên nhân" Margin="5" Grid.Column="2" Grid.Row="2" />
                                            <ComboBox x:Name="cbxNguyenNhan_tabThemTinhHuongDialog" Grid.Column="3" Grid.Row="2" 
                          Margin="5"
                          SelectedItem="{Binding NGUYENNHANTINHHUONG}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding GiaTri}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                            <TextBlock Text="Lượt đọc" Margin="5" Grid.Row="3" />
                                            <TextBox x:Name="tbxLuotDoc_tabThemTinhHuongDialog" Grid.Row="3" 
                         Grid.Column="1"  Margin="5"
                         Text="{Binding LuotDoc, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
                                            <TextBlock Text="Chủ sở hữu" Margin="5" Grid.Column="2" Grid.Row="3" />
                                            <ComboBox x:Name="cbxChuSoHuu_tabThemTinhHuongDialog" Grid.Column="3" Grid.Row="3" 
                          Margin="5"
                          SelectedItem="{Binding DOITUONG.User}">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Username}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                            <TextBlock Text="Giải pháp" Margin="5" Grid.Row="5" />
                                            <TextBox x:Name="tbxNganHang_tabThemTinhHuongDialog" Grid.Row="5" 
                         Grid.Column="1" Grid.ColumnSpan="3" Margin="5"  MinHeight="60"
                         Text="{Binding GiaiPhap}" />



                                        </Grid>
                                    </Border>
                                    <Border Margin="5" CornerRadius="5" Grid.Row="3" Grid.ColumnSpan="2" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="120"/>
                                                <ColumnDefinition Width="120"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>

                                            </Grid.RowDefinitions>
                                            <CheckBox x:Name="chkNgungTheoDoi_tabThemTinhHuongDialog" Content="Ngừng theo dõi" Margin="5,5,5,5" 
                  VerticalAlignment="Top" HorizontalAlignment="Left"
                  IsChecked="{Binding NgungTheoDoi}"/>
                                            <Button x:Name="btnCat_tabThemTinhHuongDialog" Content="Cất" Grid.Row="1" Grid.Column="2" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35"  IsDefault="True" Click="btnCat_tabThemTinhHuongDialog_Click"/>
                                            <Button x:Name="btnHuyBo_tabThemTinhHuongDialog" Content="Huỷ bỏ" Grid.Row="1" Grid.Column="3" Margin="5,10,10,5" 
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Width="100" Height="35" IsCancel="True" Click="btnHuyBo_tabThemTinhHuongDialog_Click"/>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </TabItem>
                        </TabControl>
                    </Grid>
                </TabItem>
                <!--end add dialog Them Tinh Huong-->
                <!--End add dialogs-->
                <!--
                Giao diện quản lý tổ chức
                >>> Author: cyworld
                -->
                <TabItem Header="Quản lý tổ chức" x:Name="tabToChuc">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <toolkit:DataGrid x:Name="dgrToChuc" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single"
                                          SelectionChanged="dgrToChuc_SelectionChanged">
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Tên tổ chức" Binding="{Binding TenToChuc}"/>
                                <toolkit:DataGridTextColumn Header="Tel" Binding="{Binding Tel}"/>
                                <toolkit:DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                                <toolkit:DataGridTextColumn Header="Diễn giải" Binding="{Binding DienGiai}"/>
                                <!--<toolkit:DataGridTextColumn Header="Phân loại" Binding="{Binding CHITIETPHANLOAITOCHUCs.FirstOrDefault(), Path=TenPhanLoai}"/>-->
                                <toolkit:DataGridTextColumn Header="Loại tổ chức" Binding="{Binding LOAITOCHUC.TenLoaiToChuc}"/>
                                <toolkit:DataGridTextColumn Header="Là tổ chức từ ngày" Binding="{Binding NgayLapToChuc, StringFormat=dd/MM/yyyy}"/>
                                <toolkit:DataGridTextColumn Header="Chủ sở hữu" Binding="{Binding DOITUONG.User.Username}"/>

                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>
                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>
                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="ToChuc_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="ToChuc_tabThongTin">
                                <ScrollViewer>
                                    <Grid DataContext="{Binding ElementName=dgrToChuc, Path=SelectedItem}">

                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition MinWidth="250" MaxWidth="800"/>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*" MinWidth="50"/>
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Row="0" Text="Tên tổ chức:"/>
                                        <TextBlock Grid.Row="1" Text="Tel:"/>
                                        <TextBlock Grid.Row="2" Text="Email:"/>
                                        <TextBlock Grid.Row="3" Text="Wesite:"/>
                                        <TextBlock Grid.Row="4" Text="Mã số thuế:"/>
                                        <TextBlock Grid.Row="5" Text="Ngân hàng:"/>
                                        <TextBlock Grid.Row="6" Text="Địa chỉ:"/>

                                        <TextBlock Grid.Row="0" Text="{Binding TenToChuc}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="1" Text="{Binding Tel}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="2" Text="{Binding Email}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="3" Text="{Binding Website}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="4" Text="{Binding MaSoThue, StringFormat=dd/MM/yyyy}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="5" Text="{Binding NganHang}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>
                                        <TextBlock Grid.Row="6" Text="{Binding DIACHI1.DiaChi1}" Grid.Column="1" TextWrapping="WrapWithOverflow" Margin="10,2,2,2"/>

                                    </Grid>
                                </ScrollViewer>
                            </TabItem>
                            <TabItem Header="_2.Việc cần làm" x:Name="ToChuc_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrToChuc_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Nhiệm vụ" Binding="{Binding NhiemVu}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>
                            <TabItem Header="_3.Liên hệ">
                                <toolkit:DataGrid x:Name="dgrToChuc_tabLienHe"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Họ và tên" Binding="{Binding HoVaTen}"/>
                                        <toolkit:DataGridTextColumn Header="Chức Danh" Binding="{Binding ChucDanh}"/>
                                        <toolkit:DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                                        <toolkit:DataGridTextColumn Header="Tel" Binding="{Binding Tel}"/>
                                        <toolkit:DataGridTextColumn Header="Mobile" Binding="{Binding Mobile}"/>
                                        <toolkit:DataGridTextColumn Header="Diễn giải" Binding="{Binding DienGiai}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>

                            </TabItem>
                            <TabItem Header="_4.Cơ hội">
                                <toolkit:DataGrid x:Name="dgrToChuc_tabCoHoi"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Tên cơ hội" Binding="{Binding }"/>
                                        <toolkit:DataGridTextColumn Header="Giai đoạn" Binding="{Binding}"/>
                                        <toolkit:DataGridTextColumn Header="Số tiền" Binding="{Binding }"/>
                                        <toolkit:DataGridTextColumn Header="Ngày kỳ vọng" Binding="{Binding}"/>

                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>


                            </TabItem>
                            <TabItem Header="_5.Việc đã làm">

                            </TabItem>
                            <TabItem Header="_6.Ghi chú &amp; đính kèm">

                            </TabItem>
                        </TabControl>
                        <!--End ToChucdetails tabcontrol-->
                    </Grid>
                </TabItem>
                <!--End - Giao diện quản lý Tổ chức-->

                <!--
                Giao diện quản lý Sản phẩm
                >>> Author: viettp
                -->
                <TabItem Header="Quản lý sản phẩm" x:Name="tabSanPham">
                    <toolkit:DataGrid x:Name="dgrSanPham" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single">
                        <toolkit:DataGrid.Columns>
                            <toolkit:DataGridTextColumn Header="Mã Sản phẩm" Binding="{Binding MaSanPham}"/>
                            <toolkit:DataGridTextColumn Header="Tên Sản phẩm" Binding="{Binding TenSanPham}"/>
                            <toolkit:DataGridTextColumn Header="Phân loại" Binding="{Binding PhanLoai}"/>
                            <toolkit:DataGridTextColumn Header="Đơn vị" Binding="{Binding DonVi}"/>
                            <toolkit:DataGridTextColumn Header="Đơn giá" Binding="{Binding DonGia, StringFormat='.##'}"/>
                            <toolkit:DataGridTextColumn Header="Diễn giải" Binding="{Binding DienGiai}"/>
                        </toolkit:DataGrid.Columns>
                    </toolkit:DataGrid>
                </TabItem>
                <!--End - Giao diện quản lý Sản phẩm-->

                <!--
                Giao diện quản lý Chiến dịch
                >>> Author: viettp
                -->
                <TabItem Header="Quản lý chiến dịch" x:Name="tabChienDich">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <!--List Chien dich-->
                        <toolkit:DataGrid x:Name="dgrChienDich" Margin="3" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single" >
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Tên Chiến dịch" Binding="{Binding TenChienDich}"/>
                                <toolkit:DataGridTextColumn Header="Diễn giải" Binding="{Binding DienGiai}"/>
                                <toolkit:DataGridTextColumn Header="Ngày bắt đầu" Binding="{Binding NgayBatDau}"/>
                                <toolkit:DataGridTextColumn Header="Ngày kết thúc" Binding="{Binding NgayKetThuc}"/>
                                <toolkit:DataGridTextColumn Header="Chủ sở hữu" Binding="{Binding DOITUONG.ChuSoHuu}"/>
                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>

                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>

                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="ChienDich_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="ChienDich_tabThongTin">
                                <Grid DataContext="{Binding ElementName=dgrChienDich, Path=SelectedItem}">

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto" MinWidth="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="50"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Text="Tên chiến dịch:"/>
                                    <TextBlock Grid.Row="1" Text="Diễn giải:"/>
                                    <TextBlock Grid.Row="2" Text="Tổng cơ hội:"/>
                                    <TextBlock Grid.Row="3" Text="Cơ hội thắng:"/>
                                    <TextBlock Grid.Row="4" Text="Ngày bắt đầu:"/>
                                    <TextBlock Grid.Row="5" Text="Ngày kết thúc:"/>

                                    <TextBlock Grid.Row="0" Text="{Binding TenChienDich}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding DienGiai}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding TongSoCoHoi}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding SoCoHoiThang}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding NgayBatDau, StringFormat=dd/MM/yyyy}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="5" Text="{Binding NgayKetThuc, StringFormat=dd/MM/yyyy}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>

                                    <TextBlock Grid.Row="0" Text="SL đã gửi:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="1" Text="SL hồi âm kỳ vọng:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="2" Text="Tổng số hồi âm:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="3" Text="Doanh thu kỳ vọng:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="4" Text="Chi phí dự trù:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="5" Text="Chi phí thực:" Grid.Column="2"/>

                                    <TextBlock Grid.Row="0" Text="{Binding SLDaGui}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding SLHoiAmKyVong}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding TongSoHoiAm}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding DoanhThuKyVong}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding ChiPhiDuTru}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="5" Text="{Binding ChiPhiThuc}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>

                                </Grid>
                            </TabItem>
                            <TabItem Header="2.Việc cần làm" x:Name="ChienDich_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrChienDich_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>
                            <TabItem Header="3.Danh sách đối tượng marketing">

                            </TabItem>
                            <TabItem Header="4.Cơ hội">

                            </TabItem>
                            <TabItem Header="5.Việc đã làm">

                            </TabItem>
                            <TabItem Header="6.Ghi chú &amp; đính kèm">

                            </TabItem>
                        </TabControl>

                    </Grid>
                </TabItem>
                <!--End - Giao diện quản lý Chiến dịch-->
                <!--
                Giao diện quản lý Liên hệ
                >>> Author: cyworld
                -->
                <TabItem Header="Quản lý liên hệ" x:Name="tabLienHe">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <!--List Lien He-->
                        <toolkit:DataGrid x:Name="dgrLienHe" Margin="3" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single">
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Họ và tên" Binding="{Binding HoVaTen}"/>
                                <toolkit:DataGridTextColumn Header="Chức danh" Binding="{Binding ChucDanh}"/>
                                <toolkit:DataGridTextColumn Header="Phân loại" Binding="{Binding PL}"/>
                                <toolkit:DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                                <toolkit:DataGridTextColumn Header="Tel" Binding="{Binding Tel}"/>
                                <toolkit:DataGridTextColumn Header="Mobile" Binding="{Binding Mobile}"/>
                                <toolkit:DataGridTextColumn Header="Tên tổ chức" Binding="{Binding TOCHUC.TenToChuc}"/>
                                <toolkit:DataGridTextColumn Header="Nguồn gốc" Binding="{Binding NGUONGOC.TenNguonGoc}"/>
                                <toolkit:DataGridTextColumn Header="Fax" Binding="{Binding Fax}"/>
                                <toolkit:DataGridTextColumn Header="Là liên hệ từ" Binding="{Binding NgayTao}"/>
                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>

                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>

                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="LienHe_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="LienHe_tabThongTin">
                                <Grid DataContext="{Binding ElementName=dgrLienHe, Path=SelectedItem}">

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto" MinWidth="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="50"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Text="Họ tên:"/>
                                    <TextBlock Grid.Row="1" Text="Chức danh:"/>
                                    <TextBlock Grid.Row="2" Text="Tel CQ:"/>
                                    <TextBlock Grid.Row="3" Text="Mobile:"/>
                                    <TextBlock Grid.Row="4" Text="Tel Nhà riêng:"/>
                                    <TextBlock Grid.Row="5" Text="Fax:"/>
                                    <TextBlock Grid.Row="6" Text="Email:"/>

                                    <TextBlock Grid.Row="0" Text="{Binding HoVaTen}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding ChucDanh}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding Mobile}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding TelCQ}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding TelNR}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="5" Text="{Binding Fax}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="6" Text="{Binding Email}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>

                                    <TextBlock Grid.Row="0" Text="Tên tổ chức:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="1" Text="Phòng ban:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="2" Text="Địa chỉ cơ quan:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="3" Text="Trợ lý:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="4" Text="Tel trợ lý:" Grid.Column="2"/>


                                    <TextBlock Grid.Row="0" Text="{Binding AA}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding PhongBan}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding DC}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding TroLy}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding TelTroLy}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>


                                </Grid>
                            </TabItem>
                            <TabItem Header="2.Việc cần làm" x:Name="LienHe_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrLienHe_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Nhiệm vụ" Binding="{Binding NhiemVu}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>

                            <TabItem Header="3.Cơ hội">

                            </TabItem>
                            <TabItem Header="4.Việc đã làm">

                            </TabItem>
                            <TabItem Header="5.Ghi chú &amp; đính kèm">

                            </TabItem>
                            <!--End - Giao diện quản lý Chiến dịch-->
                        </TabControl>

                    </Grid>
                </TabItem>

                <TabItem Header="Quản lý tiềm năng" x:Name="tabTiemNang">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <!--List tiem nang-->
                        <toolkit:DataGrid x:Name="dgrTiemNang" Margin="3" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single">
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Họ và tên" Binding="{Binding HoVaTen}"/>
                                <toolkit:DataGridTextColumn Header="Chức danh" Binding="{Binding ChucDanh}"/>                                
                                <toolkit:DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                                <toolkit:DataGridTextColumn Header="Tel" Binding="{Binding Tel}"/>
                                <toolkit:DataGridTextColumn Header="Mobile" Binding="{Binding Mobile}"/>
                                <toolkit:DataGridTextColumn Header="Tên công ty" Binding="{Binding CongTy}"/>
                                <toolkit:DataGridTextColumn Header="Diễn giải" Binding="{Binding DienGiai}"/>
                                <toolkit:DataGridTextColumn Header="Số lượng nhân viên" Binding="{Binding SLNhanVien}"/>
                                <toolkit:DataGridTextColumn Header="Doanh thu năm" Binding="{Binding PhongBan}"/>
                                <toolkit:DataGridTextColumn Header="Chủ sở hữu" Binding="{Binding DOITUONG.ChuSoHuu}"/>
                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>

                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>

                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="TiemNang_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="TiemNang_tabThongTin">
                                <Grid DataContext="{Binding ElementName=dgrTiemNang, Path=SelectedItem}">

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto" MinWidth="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="50"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Text="Họ tên:"/>
                                    <TextBlock Grid.Row="1" Text="Chức danh:"/>
                                    <TextBlock Grid.Row="2" Text="Tel CQ:"/>
                                    <TextBlock Grid.Row="3" Text="Mobile:"/>
                                    <TextBlock Grid.Row="4" Text="Email:"/>
                                    <TextBlock Grid.Row="5" Text="Fax:"/>
                                    

                                    <TextBlock Grid.Row="0" Text="{Binding HoVaTen}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding ChucDanh}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding Mobile}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding TelCQ}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding Email}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="5" Text="{Binding Fax}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    

                                    <TextBlock Grid.Row="0" Text="Tên công ty:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="1" Text="Phòng ban:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="2" Text="Địa chỉ cơ quan:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="3" Text="Địa chi NR:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="4" Text="Website" Grid.Column="2"/>


                                    <TextBlock Grid.Row="0" Text="{Binding CongTy}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding PhongBan}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding DIACHI.DiaChi}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding DIACHI1.DiaChi1}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding Website}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>


                                </Grid>
                            </TabItem>
                            <TabItem Header="2.Việc cần làm" x:Name="TiemNang_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrTiemNang_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Nhiệm vụ" Binding="{Binding NhiemVu}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>


                            <TabItem Header="3.Việc đã làm">

                            </TabItem>
                            <TabItem Header="4.Ghi chú &amp; đính kèm">

                            </TabItem>
                            <!--End - Giao diện quản lý Chiến dịch-->
                        </TabControl>

                    </Grid>
                </TabItem>
                <!--end tab quan ly chien dich-->
                <!--
                Giao diện quản lý Co hoi
                >>> Author: cyworld
                -->
                <TabItem Header="Quản lý cơ hội" x:Name="tabCoHoi">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <!--List Lien He-->
                        <toolkit:DataGrid x:Name="dgrCoHoi" Margin="3" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single">
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Tên cơ hội" Binding="{Binding TenCoHoi}"/>                                
                                <toolkit:DataGridTextColumn Header="Chiến dịch" Binding="{Binding CHIENDICH.TenChienDich}"/>
                                <!--<toolkit:DataGridTextColumn Header="Phân loại" Binding="{Binding PL}"/>-->
                                <toolkit:DataGridTextColumn Header="Giai đoạn" Binding="{Binding GIAIDOANCOHOI.TenGiaiDoan}"/>
                                <toolkit:DataGridTextColumn Header="Nguồn gốc" Binding="{Binding NguonGoc}"/>
                                <toolkit:DataGridTextColumn Header="Tên tổ chức" Binding="{Binding TOCHUC.TenToChuc}"/>                                
                                <toolkit:DataGridTextColumn Header="Loại" Binding="{Binding Loai}"/>
                                <toolkit:DataGridTextColumn Header="Số tiền" Binding="{Binding SoTien}"/>
                                <toolkit:DataGridTextColumn Header="Tỉ lệ thành công" Binding="{Binding GIAIDOANCOHOI.TiLeThanhCong}"/>
                                <toolkit:DataGridTextColumn Header="Ngày kỳ vọng" Binding="{Binding NgayKyVong}"/>
                                <toolkit:DataGridTextColumn Header="Chủ sở hữu" Binding="{Binding DOITUONG.ChuSoHuu}"/>
                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>

                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>

                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="CoHoi_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="CoHoi_tabThongTin">
                                <Grid DataContext="{Binding ElementName=dgrCoHoi, Path=SelectedItem}">

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto" MinWidth="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="50"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Text="Tên cơ hội:"/>
                                    <TextBlock Grid.Row="1" Text="Tên tổ chức:"/>
                                    <TextBlock Grid.Row="2" Text="Loại:"/>
                                    <TextBlock Grid.Row="3" Text="Bước tiếp theo:"/>
                                    <TextBlock Grid.Row="4" Text="Tỉ lệ thành công:"/>
                                    <TextBlock Grid.Row="5" Text="Số tiền:"/>
                                    

                                    <TextBlock Grid.Row="0" Text="{Binding TenCoHoi}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding TOCHUC.TenToChuc}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding Loai}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="3" Text="{Binding BuocTiepTheo}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="4" Text="{Binding TiLeThanhCong}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="5" Text="{Binding SoTien}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <!--<TextBlock Grid.Row="0" Text="Doanh thu kỳ vọng:" Grid.Column="2"/>-->
                                    <TextBlock Grid.Row="1" Text="Lý do thắng thua:" Grid.Column="2"/>
                                    <TextBlock Grid.Row="2" Text="Ngày kết thúc:" Grid.Column="2"/>
                                    
                                    <TextBlock Grid.Row="0" Text="{Binding CHIENDICH.DoanhThuKyVong}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding LyDoThangThua}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding NgayKetThuc}" Grid.Column="3" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    
                                </Grid>
                            </TabItem>
                            <TabItem Header="_2.Việc cần làm" x:Name="CoHoi_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrCoHoi_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Nhiệm vụ" Binding="{Binding NhiemVu}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>

                            <TabItem Header="_3.Liên hệ">

                            </TabItem>
                            
                            <TabItem Header="_4.Đối tác">

                            </TabItem>
                            <TabItem Header="_5.Đối thủ">

                            </TabItem>
                            <TabItem Header="_6.Sản phẩm">

                            </TabItem>
                            <TabItem Header="_7.Việc đã làm">

                            </TabItem>
                            <TabItem Header="_8.Ghi chú &amp; đính kèm">

                            </TabItem>
                            <!--End - Giao diện quản lý Chiến dịch-->
                        </TabControl>

                    </Grid>
                </TabItem>
                <!--end tab quan ly Co hoi-->
                <!--
                Giao diện quản lý Tinh Huong
                >>> Author: cyworld
                -->
                <TabItem Header="Quản lý tình huống" x:Name="tabTinhHuong">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.7*"/>
                            <RowDefinition Height="0.3*"/>
                        </Grid.RowDefinitions>

                        <!--List Lien He-->
                        <toolkit:DataGrid x:Name="dgrTinhHuong" Margin="3" CanUserAddRows="False" 
                                          CanUserDeleteRows="False"
                                          AutoGenerateColumns="False" SelectionMode="Single">
                            <toolkit:DataGrid.Columns>
                                <toolkit:DataGridTextColumn Header="Mã hiệu" Binding="{Binding MaHieu}"/>
                                <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                <toolkit:DataGridTextColumn Header="Phân loại" Binding="{Binding PhanLoai}"/>
                                <toolkit:DataGridTextColumn Header="Mức ưu tiên" Binding="{Binding MucUuTien}"/>
                                <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                <toolkit:DataGridTextColumn Header="Loại" Binding="{Binding Loai}"/>
                                <toolkit:DataGridTextColumn Header="Tên chủ sở hữu" Binding="{Binding DOITUONG.User.Username}"/>
                                <toolkit:DataGridTextColumn Header="Tên người tạo" Binding="{Binding DOITUONG.User1.Username}"/>
                            </toolkit:DataGrid.Columns>
                        </toolkit:DataGrid>

                        <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>

                        <!--Chien Dich Detail tabcontrol-->
                        <TabControl Grid.Row="1" Margin="3" x:Name="TinhHuong_DetailTabs">
                            <TabItem Header="_1.Thông tin chung" x:Name="TinhHuong_tabThongTin">
                                <Grid DataContext="{Binding ElementName=dgrTinhHuong, Path=SelectedItem}">

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                       
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto" MinWidth="250"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="50"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Text="Chủ đề:"/>
                                    <TextBlock Grid.Row="1" Text="Diễn giải:"/>
                                    <TextBlock Grid.Row="2" Text="Giải pháp:"/>

                                    <TextBlock Grid.Row="0" Text="{Binding ChuDe}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="1" Text="{Binding DienGiai}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                    <TextBlock Grid.Row="2" Text="{Binding GiaiPhap}" Grid.Column="1" TextWrapping="Wrap" Margin="10,2,2,2"/>
                                   
                                </Grid>
                            </TabItem>
                            <TabItem Header="_2.Việc cần làm" x:Name="TinhHuong_tabViecCanLam">
                                <toolkit:DataGrid x:Name="dgrTinhHuong_tabViecCanLam"
                                                  AutoGenerateColumns="False">
                                    <toolkit:DataGrid.Columns>
                                        <toolkit:DataGridTextColumn Header="Chủ đề" Binding="{Binding ChuDe}"/>
                                        <toolkit:DataGridTextColumn Header="Nhiệm vụ" Binding="{Binding NhiemVu}"/>
                                        <toolkit:DataGridTextColumn Header="Tình trạng" Binding="{Binding TinhTrang}"/>
                                        <toolkit:DataGridTextColumn Header="Ngày hết hạn" Binding="{Binding NgayHetHan, StringFormat=dd/MM/yyyy}"/>
                                        <toolkit:DataGridTextColumn Header="Phân công" Binding="{Binding DOITUONG2.ChuSoHuu}"/>
                                    </toolkit:DataGrid.Columns>
                                </toolkit:DataGrid>
                            </TabItem>

                            <TabItem Header="_3.Liên hệ">

                            </TabItem>

                            <TabItem Header="_4.Việc đã làm">

                            </TabItem>
                            
                            <TabItem Header="_5.Ghi chú và đính kèm">

                            </TabItem>
                           
                            <!--End - Giao diện quản lý Chiến dịch-->
                        </TabControl>

                    </Grid>
                </TabItem>
                <!--end tab quan ly Tinh Huong-->
            </TabControl>

            <!--End - Main Content for all features-->

        </Grid>
    </Grid>
</ribbon:RibbonWindow>
